/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package database.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Stefan
 */
@Entity
@Table(name = "shop_image")
@NamedQueries({
    @NamedQuery(name = "ShopImage.findAll", query = "SELECT s FROM ShopImage s"),
    @NamedQuery(name = "ShopImage.findByShopimageid", query = "SELECT s FROM ShopImage s WHERE s.shopimageid = :shopimageid"),
    @NamedQuery(name = "ShopImage.findByShopimageurl", query = "SELECT s FROM ShopImage s WHERE s.shopimageurl = :shopimageurl"),
    @NamedQuery(name = "ShopImage.findByShopimagerelativepath", query = "SELECT s FROM ShopImage s WHERE s.shopimagerelativepath = :shopimagerelativepath")})
public class ShopImage implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "SHOPIMAGEID")
    private Integer shopimageid;
    @Basic(optional = false)
    @Column(name = "SHOPIMAGEURL")
    private String shopimageurl;
    @Basic(optional = false)
    @Column(name = "SHOPIMAGERELATIVEPATH")
    private String shopimagerelativepath;
    @Basic(optional = false)
    @Column(name = "SHOPIMAGENAME")
    private String shopimagename;
    @Basic(optional = false)
    @Column(name = "SHOPIMAGELENGTH")
    private long shopimagelength;
    @Basic(optional = false)
    @Column(name = "SHOPIMAGETYPE")
    private String shopimagetype;
    
    @JoinColumn(name = "ITEMID", referencedColumnName = "ITEMID")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private ShopItem shopItem;

    public ShopImage() {
    }

    public ShopImage(Integer shopimageid) {
        this.shopimageid = shopimageid;
    }

    public ShopImage(Integer shopimageid, String shopimageurl, String shopimagerelativepath) {
        this.shopimageid = shopimageid;
        this.shopimageurl = shopimageurl;
        this.shopimagerelativepath = shopimagerelativepath;
    }

    public Integer getShopimageid() {
        return shopimageid;
    }

    public void setShopimageid(Integer shopimageid) {
        this.shopimageid = shopimageid;
    }

    public String getShopimageurl() {
        return shopimageurl;
    }

    public void setShopimageurl(String shopimageurl) {
        this.shopimageurl = shopimageurl;
    }

    public String getShopimagerelativepath() {
        return shopimagerelativepath;
    }

    public void setShopimagerelativepath(String shopimagerelativepath) {
        this.shopimagerelativepath = shopimagerelativepath;
    }

    public ShopItem getShopItem() {
        return shopItem;
    }

    public void setShopItem(ShopItem shopItem) {
        this.shopItem = shopItem;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shopimageid != null ? shopimageid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShopImage)) {
            return false;
        }
        ShopImage other = (ShopImage) object;
        if ((this.shopimageid == null && other.shopimageid != null) || (this.shopimageid != null && !this.shopimageid.equals(other.shopimageid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "database.entity.ShopImage[shopimageid=" + shopimageid + "]";
    }

	public void setShopimagename(String shopimagename) {
		this.shopimagename = shopimagename;
	}

	public String getShopimagename() {
		return shopimagename;
	}

	public void setShopimagelength(long shopimagelength) {
		this.shopimagelength = shopimagelength;
	}

	public long getShopimagelength() {
		return shopimagelength;
	}

	public void setShopimagetype(String shopimagetype) {
		this.shopimagetype = shopimagetype;
	}

	public String getShopimagetype() {
		return shopimagetype;
	}

}
